<template>
  <div class="information">
    <div class="myAccountInfo">
      <div class="info">
        <div class="head">
          <img src="../assets/img/head/头像.png" alt="">
        </div>
        <div class="personalInfo">
          <span class="name">{{userInfo.name}}</span>
          <span class="phone">{{userInfo.phone}}</span>
          <a>修改密码 ></a>
        </div>
      </div>
    </div>
    <div class="recent_orders">
      <div class="recent_top">
        <h3>最近订单</h3>
        <router-link :to="'/mydji/myorder'">查看全部订单 ></router-link>
      </div>
      <div class="recent_list">
        <order-record />
        <order-record />
      </div>
    </div>
  </div>
</template>

<script>
import {mapState,mapActions} from 'vuex'
import orderRecord from '../components/orderRecord.vue'
export default {
  data() {
    return {

    }
  },
  components:{
    orderRecord
  },
  created() {
    this.getOrders();
    console.log(this.orderList);
  },
  computed: {
    ...mapState('order',['orderList']),
    ...mapState('loginInfo',['userInfo'])
  },
  methods: {
    ...mapActions('order',['getOrders'])
  },

};
</script>

<style lang="scss">
.information {
  width: 100%;
  .myAccountInfo {
    background-color: white;
    .info {
      padding: 32px;
      display: flex;
      .head {
        img {
          width: 64px;
        }
      }
      .personalInfo {
        span,a {
          // display: block;
          margin: 0 0 12px 24px;
        }
        .name {
          font-size: 20px;
        }
        .phone {
          font-size: 18px;
        }
        a {
          display: block;
          font-size: 15px;
          color: #1890ff;
          margin-top: 24px;
        }
      }
    }
  }
  .recent_orders {
    background-color: white;
    margin: 16px 0 0 0;
    padding: 32px 32px 56px;
    .recent_top {
      display: flex;
      justify-content: space-between;
      h3 {
        font-size: 24px;
      }
      a {
        color: #1890ff;
      }
    }
    .recent_list {
      margin: 8px 0;
    }
  }
}
</style>